﻿#region 命名空间

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;
using WinnerCMS.Model.Attribute;

#endregion

namespace WinnerCMS.WebUI.Admin.SecurityCenter
{
    [Access("267003")]
    public partial class FileReport : WebFactory.PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind(1);
            }
        }

        private void Bind(int PageNo)
        {
            this.GV_List.EmptyDataTemplate = GetTemplate(this);
            this.brPath.InitData("安全中心,文件扫描日志");

            var pp = new PagingParam();
            pp.PageSize = this.PageNavigation1.PageSize;
            pp.PageNo = PageNo;
            this.GV_List.DataSource = new SecurityCenterManage().BindList(1, pp);
            this.GV_List.DataBind();

            this.PageNavigation1.RecordCount = pp.RecordCount;
        }


        protected void PageNavigation1_PageChanging(object src, WebControls.PageChangingEventArgs e)
        {
            Bind(e.NewPageIndex);
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            var IDs = GetSelectedRow.GetIDs(this.GV_List);
            new SecurityCenterManage().Delete(IDs, this.UpdatePanel1);
            Bind(1);
        }

        protected void btnClear_Click(object sender, EventArgs e)
        {
            new SecurityCenterManage().Delete(1, this.UpdatePanel1);
            Bind(1);
        }
    }
}